home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
pc_board
/
sendcom.zip
/
MYFILE.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1991-10-14
|
819b
|
34 lines
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
#include "myfile.h"
//:::::::::::::::[ CLASS myfile MEMBER DECLARATIONS ]:::::::::::::::::::::::
// CONSTRUCTOR (CURRENTLY NOT USED, SET UP FOR FUTURE PURPOSES)
//
myfile::myfile(){
handle=-1;
}
// OPEN FILE AND RETURN STATUS (0=GOOD -1=ERROR)
// BY DEFAULT ONLY PATHNAME IS REQUIRED. IF NO ACCESS OR MODE IS SPECIFIED
// mopen WILL USE int mopen(pathname, O_RDONLY|O_BINARY|O_DENYNONE, 0)
//
int myfile::mopen(const char *path, int access, int mode){
if ((handle = open(path, access, mode))==-1){
perror("Error:");
return(handle);
}
return(0);
}
// CLOSE FILE PREVIOUSLY OPENED WITH mopen()
//
void myfile::mclose(){
close(handle);
}